{% extends '../common/common.html' %}
{% block main %}
<div class="admin-box">
    <div class="crumbs-nav">
        <a href="/admin">管理首页</a> &gt; <span>内容管理</span>
    </div>
    <h2 class="admin-title">内容管理</h2>
    <div class="admin-table">

        <table>
            <tr>
                <th>ID</th>
                <th>分类</th>
                <th>标题</th>
                <th>作者</th>
                <th>添加时间</th>
                <th>阅读量</th>
                <th>操作</th>
            </tr>

            {% for contents in contents %}
            <tr>
                <td width="120px">{{ contents.id }}</td>
                <td>{{ contents.name }}</td>
                <td>{{ contents.title }}</td>
                <td>{{ contents.nickname }}</td>
                <td>{{ contents.addTime|date('Y-m-d h:i:s',-8*60) }}</td>
                <td>{{ contents.views }}</td>
                <td width="100px">
                    <a href="content/edit?id={{ contents.id }}">修改</a> | <a onclick="return confirm('确定删除吗？');" href="content/del?id={{ contents.id }}">删除</a>
                </td>
            </tr>
            {% endfor %}
        </table>
    </div>
    {% include '../common/pages.html' %}
</div>
{% endblock %}